package com.hyzx.qbasic.admin.domain.dao;

import com.hyzx.qbasic.admin.model.po.ResourceInfoPO;
import com.hyzx.qbasic.admin.model.po.ResourcePO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * Created by 黄江华 on 2017/9/30
 */

public interface ResourceMapper {
    List<ResourcePO> getAllResourceList();

    Set<String> getPermissionList(@Param("roleList") Set<String> roleList);

    Set<String> getPermittedUrlList(@Param("roleList") Set<String> roleList);

    List<ResourcePO> getMenuList(@Param("roleList") Set<String> roleList);

    List<ResourcePO> getFunctionList(@Param("roleList") Set<String> roleList);

    List<ResourceInfoPO> getPagedResourceList(@Param("resourceName") String resourceName, @Param("resourceId") Integer resourceId);

    int addResource(ResourcePO resource);

    ResourcePO getResourceInfo(@Param("resourceId") int resourceId);

    int editResource(ResourcePO resource);

    int deleteResource(List<Integer> resourceIdList);

    int deleteResourceRoles(List<Integer> resourceIdList);

    List<Integer> getResourceRoles(@Param("permission") String permission);
}
